Skip to content

[docs] Self-healing documentation fixes from issue analysis - 2026-03-10#20412

Merged
pelikhan merged 1 commit intomainfrom
doc-healer-2026-03-10-gh-aw-runtime-envvars-c08efa7369783cc1
Mar 10, 2026
Merged

[docs] Self-healing documentation fixes from issue analysis - 2026-03-10#20412
pelikhan merged 1 commit intomainfrom
doc-healer-2026-03-10-gh-aw-runtime-envvars-c08efa7369783cc1

Conversation

@github-actions
Copy link
Contributor

Self-Healing Documentation Fixes

This PR was automatically created by the Daily Documentation Healer workflow.

Gaps Fixed

Root Cause

DDUw ran at 04:22 UTC on 2026-03-10 and produced PR #20306 (merged 04:47 UTC). PR #20382 (Add GITHUB_AW, GH_AW_PHASE, and GH_AW_VERSION env vars) was merged at 16:40 UTC — over 12 hours after DDUw completed. This is the same late-merge blind-spot pattern as the previous healer run (PR #20254), where a late-day merge falls entirely outside DDUw's scan window.

DDUw Improvement Suggestions

  1. Run DDUw twice daily (e.g. 06:00 UTC and 20:00 UTC) to reduce the blind spot from ~20 hours to ~10 hours. The current single 06:00 UTC run leaves a ~20-hour window where late-merged features are only caught the following day — by which point DDUw may skip them because they no longer appear in a fresh "last 24 hours" query.
  2. Expand the scan window to 36–48 hours on each run. A wider window with deduplication (skip already-documented features) would reliably catch features merged late in the prior day without requiring a schedule change.

Analyzed Issues (last 7 days, label: documentation, state: closed)

Issue Title DDUw addressed? Action
#20370 [cli-consistency] CLI Consistency Issues - Help Flag Descriptions Addressed by PR #20375 (CLI fix) + PR #20306 (docs) No action
#20248 Improve actionability of failure issues Addressed by PR #20266 + PR #20306 No action
#20241 Staged mode support needs better docs Addressed by PR #20269 (dedicated staged-mode.md page) No action
#20218 [cli-consistency] CLI Consistency Issues and Missing Flags Addressed by PR #20272 + PR #20306 No action
#19866 [cli-consistency] CLI Consistency Issues - 2026-03-06 CLI binary help text, not docs/ No action
#19836 [research] Overview of docs improver agents Research question, not a docs gap No action
#19815 [ubuntu-image] research: update Ubuntu runner image analysis research/ file, not docs/ No action
#19727 [cli-consistency] CLI Consistency Issues - 2026-03-05 CLI binary help text No action
#19603 [workflow-style] Normalize report formatting Workflow instruction file, not docs/ No action
#19601 [cli-consistency] CLI Consistency Issues - 2026-03-04 CLI binary help text No action
#19222 [cli-consistency] CLI Consistency Issues - 2026-03-02 CLI binary help text No action

The gap for GITHUB_AW/GH_AW_PHASE/GH_AW_VERSION was discovered by cross-referencing commits merged after DDUw's last run, not from a closed issue.

Files Changed

  • docs/src/content/docs/reference/environment-variables.md — added "System-Injected Runtime Variables" section with table and code example for GITHUB_AW, GH_AW_PHASE, GH_AW_VERSION

Related

Generated by Daily Documentation Healer ·

  • expires on Mar 12, 2026, 7:27 PM UTC

Generated by Daily Documentation Healer ·

  • expires on Mar 13, 2026, 7:26 PM UTC

…W_PHASE, GH_AW_VERSION runtime variables

Added a new "System-Injected Runtime Variables" section documenting the
three env vars automatically injected by the gh-aw compiler into every
agentic engine execution step (PR #20382).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added automation documentation Improvements or additions to documentation labels Mar 10, 2026
@pelikhan pelikhan marked this pull request as ready for review March 10, 2026 22:28
Copilot AI review requested due to automatic review settings March 10, 2026 22:28
@pelikhan pelikhan merged commit 726232a into main Mar 10, 2026
1 check passed
@pelikhan pelikhan deleted the doc-healer-2026-03-10-gh-aw-runtime-envvars-c08efa7369783cc1 branch March 10, 2026 22:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing documentation for system-injected runtime environment variables exposed to agentic engine execution steps, addressing a late-merge documentation gap.

Changes:

  • Added a new System-Injected Runtime Variables section documenting GITHUB_AW, GH_AW_PHASE, and GH_AW_VERSION
  • Included a table of meanings plus a compiled-workflow env: example and a NOTE about override behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


## System-Injected Runtime Variables

GitHub Agentic Workflows automatically injects the following environment variables into every agentic engine execution step (both the main agent run and the threat detection run). These variables are read-only from the agent's perspective and are useful for writing workflows or agents that need to detect their execution context.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence uses incorrect verb agreement: “GitHub Agentic Workflows … injects” should be “inject” (plural subject).

Suggested change
GitHub Agentic Workflows automatically injects the following environment variables into every agentic engine execution step (both the main agent run and the threat detection run). These variables are read-only from the agent's perspective and are useful for writing workflows or agents that need to detect their execution context.
GitHub Agentic Workflows automatically inject the following environment variables into every agentic engine execution step (both the main agent run and the threat detection run). These variables are read-only from the agent's perspective and are useful for writing workflows or agents that need to detect their execution context.

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +117
| `GITHUB_AW` | `"true"` | Present in every gh-aw engine execution step. Agents can check for this variable to confirm they are running inside a GitHub Agentic Workflow. |
| `GH_AW_PHASE` | `"agent"` or `"detection"` | Identifies which execution phase is active. `"agent"` for the main run; `"detection"` for the threat-detection safety check run that precedes the main run. |
| `GH_AW_VERSION` | e.g. `"0.40.1"` | The gh-aw compiler version that generated the workflow. Useful for conditional logic that depends on a minimum feature version. |

These variables appear alongside other `GH_AW_*` context variables in the compiled workflow:

```yaml
env:
GITHUB_AW: "true"
GH_AW_PHASE: agent # or "detection"
GH_AW_VERSION: "0.40.1"
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documented example values don’t match the compiled workflows produced by the compiler: lock files show GITHUB_AW: true (unquoted) and GH_AW_VERSION is typically a short build/version string (e.g. 3f30e4d), not necessarily a semver like 0.40.1. Consider updating the table and YAML example to reflect the actual emitted values (or clarify that it may be a commit SHA / dev / release version depending on build).

Suggested change
| `GITHUB_AW` | `"true"` | Present in every gh-aw engine execution step. Agents can check for this variable to confirm they are running inside a GitHub Agentic Workflow. |
| `GH_AW_PHASE` | `"agent"` or `"detection"` | Identifies which execution phase is active. `"agent"` for the main run; `"detection"` for the threat-detection safety check run that precedes the main run. |
| `GH_AW_VERSION` | e.g. `"0.40.1"` | The gh-aw compiler version that generated the workflow. Useful for conditional logic that depends on a minimum feature version. |
These variables appear alongside other `GH_AW_*` context variables in the compiled workflow:
```yaml
env:
GITHUB_AW: "true"
GH_AW_PHASE: agent # or "detection"
GH_AW_VERSION: "0.40.1"
| `GITHUB_AW` | `true` | Present in every gh-aw engine execution step. Agents can check for this variable to confirm they are running inside a GitHub Agentic Workflow. |
| `GH_AW_PHASE` | `"agent"` or `"detection"` | Identifies which execution phase is active. `"agent"` for the main run; `"detection"` for the threat-detection safety check run that precedes the main run. |
| `GH_AW_VERSION` | e.g. `"3f30e4d"` | The gh-aw compiler version that generated the workflow (often a short commit SHA, `dev`, or a release version). Useful for conditional logic that depends on a minimum feature version. |
These variables appear alongside other `GH_AW_*` context variables in the compiled workflow:
```yaml
env:
GITHUB_AW: true
GH_AW_PHASE: agent # or "detection"
GH_AW_VERSION: "3f30e4d" # e.g. short commit SHA, dev, or release version

Copilot uses AI. Check for mistakes.
```

> [!NOTE]
> These variables are injected by the compiler and cannot be overridden by user-defined `env:` blocks in the workflow frontmatter.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NOTE claims these variables “cannot be overridden by user-defined env: blocks in the workflow frontmatter”, but the compiler currently injects these keys and then merges user-provided engine.env / agent env afterwards (e.g. maps.Copy(env, workflowData.EngineConfig.Env) in pkg/workflow/copilot_engine_execution.go), which allows overriding GITHUB_AW, GH_AW_PHASE, or GH_AW_VERSION. Either adjust the docs to reflect actual precedence, or reserve/validate these names in the compiler so the NOTE stays accurate.

Suggested change
> These variables are injected by the compiler and cannot be overridden by user-defined `env:` blocks in the workflow frontmatter.
> These variables are injected by the compiler as defaults for the engine execution context. They can be overridden by user-defined `engine.env` or agent-specific `env` blocks in the workflow frontmatter, but are not affected by workflow-, job-, or step-level `env:` scopes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-inspected automation documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants